"""          
Time : 2024/5/31 下午3:26
Author : TJC
@FileName: page_baidu.py
@Desc: 
"""
import allure
from utils.timer import sleep
from page_base.page_base import Base
from page_element import test_baidu

class PageBaidu(Base):

    def page_input_value(self, value):
        """输入内容"""
        self.base_input(test_baidu.btn_kw, value)
        # sleep(5)

    def page_click_login_btn(self):
        """点击登录按钮"""
        self.base_click(test_baidu.btn_click)
        # sleep(5)

    def page_get_info(self):
        """获取搜索后的信息"""
        return self.base_get_text(test_baidu.value_res)

    def page_baidu(self, value):
        with allure.step(f"百度搜索: {value}"):
            self.page_input_value(value)
        sleep(5)
        with allure.step("点击搜索按钮"):
            self.page_click_login_btn()